Skip to content

Frontend - #37

Open
NikhByte wants to merge 16 commits into
stagingfrom
frontend
Open

NikhByte wants to merge 16 commits into
stagingfrom
frontend

Conversation

@NikhByte

Copy link
Copy Markdown
Collaborator

Merging Frontend to the Staging

…oise

- Add _EXCLUDE_EXACT_NAMES and _EXCLUDE_SUBSTRINGS sets to silently
  drop Chrome/Chromium (Streamlit dashboard) and CogniOS daemon processes
  from process telemetry to prevent corrupting compiler_active signal
  and inflating CPU readings in FocusOS inference
- Add UDP/TCP ratio calculation via psutil.net_connections with graceful
  fallback (0.10) on permission error
- Pass udp_tcp_ratio through the metrics dict and into write_layer1()
  in the daemon loop
Doubled SLIDING_WIND_N to 30 to give FocusOS feature extraction more
telemetry history per inference cycle, reducing variance in short-burst
workload misclassifications.
Rewrote extract_features() to produce the full 22-feature statistical
vector that matches the IdeaPad training dataset schema:

- cpu_mean, cpu_max, cpu_variance
- ram_mean, ram_growth_rate, swap_percent
- network_mean, network_symmetry, net_variance, udp_tcp_ratio
- disk_io_mean, process_count_mean, thread_count_mean
- load_avg, ctx_switches_per_core, cpu_user_system_ratio
- psi_cpu_some, psi_mem_some, psi_io_some
- vscode_active, browser_active, compiler_active

Added timestamp-aware time-delta computation, ddof=0 variance, and
safe column presence checks throughout.
…ition

Rewrote WorkloadPredictor and training pipeline in classifier.py:
- Added full 22-feature schema (matches generate_dataset_ideapad.py)
- Integrated StandardScaler alongside LabelEncoder for robust normalization
- Added StratifiedKFold cross-validation with cross_val_score reporting
- Candidate dataset path resolution (searches project root, ~/home, etc.)
- Path now resolves to focusos/models/models_saved/ for local artifacts

Updated cluster_trainer.py:
- Minor config alignment with new MODELS_DIR path conventions
…l artifacts

Removed:
- focusos/models/focusos_training_data.csv (old pseudo-labeled dataset, 3001 rows)
- focusos/models/generate_dataset.py (old synthetic dataset generator)
- focusos/models_saved/kmeans_model.pkl (unsupervised clustering no longer used)
- focusos/models_saved/pseudo_labeled_dataset.csv (replaced by IdeaPad dataset)

Updated saved model artifacts to reflect the new 22-feature IdeaPad schema:
- feature_columns.pkl: 15→22 feature names
- label_encoder.pkl: updated class mappings
- scaler.pkl: re-fit StandardScaler on IdeaPad data
- xgboost_model.json: re-trained model checkpoint
Extend the write_layer1() signature and INSERT statement to accept
a udp_tcp_ratio column (default 0.10) in the layer1_sys table.
This prepares the schema for the new FocusOS 22-feature network metric.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants